<template>
	<view class="login-page">
		<image class="logo" src="https://ribotrade-oss.oss-cn-beijing.aliyuncs.com/2025/05/04e2b336d4588e446abc23ac889dc1b146image.png"></image>

		<view @click="login" class="login-btn primary-btn">
			本机手机号一键登录
		</view>

		<view class="login-btn secondary-btn">
			注册
		</view>

		<view class="third-login">
			<view class="divider">第三方登录</view>
			<view class="third-icons">
				<view class="icon phone-icon"></view>
				<view class="icon qq-icon"></view>
				<view class="icon wechat-icon"></view>
			</view>
		</view>
	</view>
</template>

<script setup>
import {onLoad} from '@dcloudio/uni-app';
import sheep from '@/sheep';

function login() {
	let loginInfo = {
		username: "IM 测试用户"
	}
	uni.setStorage({
		key: 'loginInfo',
		data: loginInfo
	});
	// 进入首页
	uni.reLaunch({
		url: '/pages/index/index'
	});
}

onLoad(async (options) => {

});
</script>

<style scoped lang="scss">
.login-page {
	padding-top: 160rpx;
	width: 100vw;
	height: 100vh;
	background: linear-gradient(to bottom, #fcd4e1, #f8e2fb, #d8cfff);
	display: flex;
	flex-direction: column;
	align-items: center;
}

.logo {
	//width: 200rpx;
	height: 20rem;
}

.login-btn {
	width: 70%;
	height: 90rpx;
	margin-top: 40rpx;
	border-radius: 45rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 32rpx;
	color: #333;
	box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.08);
}

.primary-btn {
	background: linear-gradient(to right, #ffc7a6, #ffe086);
}

.secondary-btn {
	background-color: rgba(255, 255, 255, 0.5);
}

.third-login {
	position: absolute;
	bottom: 80rpx;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	font-size: 24rpx;
	color: #888;
}

.divider {
	position: relative;
	width: 80%;
	text-align: center;
	margin-bottom: 40rpx;

	&::before, &::after {
		content: '';
		position: absolute;
		top: 50%;
		width: 25%;
		height: 1rpx;
		background-color: #ccc;
	}

	&::before {
		left: 0;
	}

	&::after {
		right: 0;
	}
}

.third-icons {
	display: flex;
	justify-content: center;
}

.icon {
	width: 80rpx;
	height: 80rpx;
	margin: 0 30rpx;
	border-radius: 50%;
	background-size: 50%;
	background-repeat: no-repeat;
	background-position: center;
	box-shadow: 0 6rpx 12rpx rgba(0, 0, 0, 0.1);
}

.phone-icon {
	background-color: #ffb54c;
	background-image: url('https://ribotrade-oss.oss-cn-beijing.aliyuncs.com/2025/05/04a14bbc4a89ae484e8a8fdcc71deb8079image.png');
}

.qq-icon {
	background-color: #41b8ff;
	background-image: url('https://ribotrade-oss.oss-cn-beijing.aliyuncs.com/2025/05/0428d81c3ea0ed41b283207028b9e43690image.png');
}

.wechat-icon {
	background-color: #fff;
	background-image: url('https://ribotrade-oss.oss-cn-beijing.aliyuncs.com/2025/05/049839d6581f4b4162866b2b02c7908fa7image.png');
	border: 1rpx solid #ccc;
}
</style>
